home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
5
/
READER_1
/
FDS__1_0
/
SOUNDEDI
/
FORMATDR.P
next >
Wrap
Text File
|
1992-07-19
|
2KB
|
94 lines
unit FormatDriver;
interface
const
rmInit = 1;
rmDispose = 2;
rmOpen = 3;
rmClose = 4;
rmPrint = 5;
rmCopy = 6;
rmSelectAll = 7;
rmMenuSelect = 8;
rmMenuUpdate = 9;
rmDraw = 10;
rmResize = 11;
rmActivate = 12;
rmDeactivate = 13;
rmInContent = 14;
rmInControl = 15;
rmPrintPage = 16;
ALRTinfo = 131;
rmNoErr = 0;
rmError = 1;
type
SysEnvPtr = ^SysEnvRec;
function GetVControl (window: WindowPtr): ControlHandle;
function GetHControl (window: WindowPtr): ControlHandle;
procedure InfoAlert (strID: Integer);
implementation
function GetVControl (window: WindowPtr): ControlHandle;
var
control: ControlHandle;
title: Str255;
begin
control := WindowPeek(window)^.controlList;
while control <> nil do
begin
GetCTitle(control, title);
if title = 'v' then
begin
GetVControl := control;
Exit(GetVControl);
end;
control := control^^.nextControl;
end;
GetVControl := nil;
end;
function GetHControl (window: WindowPtr): ControlHandle;
var
control: ControlHandle;
title: Str255;
begin
control := WindowPeek(window)^.controlList;
while control <> nil do
begin
GetCTitle(control, title);
if title = 'h' then
begin
GetHControl := control;
Exit(GetHControl);
end;
control := control^^.nextControl;
end;
GetHControl := nil;
end;
procedure InfoAlert (strID: Integer);
var
itemHit: Integer;
strHdl: StringHandle;
theStr: Str255;
begin
strHdl := GetString(strID);
if strHdl = nil then
begin
SysBeep(0);
Exit(InfoAlert);
end;
theStr := strHdl^^;
ReleaseResource(Handle(strHdl));
ParamText(theStr, '', '', '');
InitCursor;
itemHit := NoteAlert(ALRTinfo, nil);
end;
end.